<template>
  <div>
    <img class="back-ground"
         v-lazy="imgUrl"/>
  </div>
</template>

<script type="text/ecmascript-6">
  import Public from '@/assets/js/public';

  export default {
    /** kebab-case */
    name: 'background-img',

    data() {
      return {
        imgUrl: 'http://sxian.oss-cn-beijing.aliyuncs.com/pages/background_sx.jpg'
      };
    },
    /** 在声明 prop 的时候，其命名应该始终使用 camelCase，而在模板和 JSX 中应该始终使用 kebab-case。
     String/Number/Boolean/Function/Object/Array/Symbol */
    props: {},

    components: {},

    methods: {
      getIcon(icon) {
        return Public.ossImg + icon + '.svg';
      }
    },
    computed: {},
    watch: {
      // 监听具体数据变化，并做相应的处理
    }
  };
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped>
  @import "../../assets/stylus/main.styl";
  .flex-r
    flex-x()

  .flex-c
    flex-y()

  .center
    flex-center()

  .divider
    divider()

  .space
    space()

  .back-ground
    position absolute
    top 0
    z-index -10
    width 100vw
    left 0

  .img-wrapper[lazy=loading] {
    background third-ash
    width: 100%;
    height: 10vw
  }
</style>
